package com.shop.product;

public class Product {
  private String name;
  private String description;
  private double price;
  private double quantity;
  
  /*
   * Konstruktor
   */
  public Product(String name, String description, double price, double quantity) {
    this.name = name;
    this.description = description;
    this.price = price;
    this.quantity = quantity;
  }
  
  /*
   * Gettery i settery
   */
  public String getName() { return name; }
  public void setName(String name) { this.name = name; }
  public String getDescription() { return description; }
  public void setDescription(String description) { this.description = description; }
  public double getPrice() { return price; }
  public void setPrice(double price) { this.price = price; }
  public double getQuantity() { return quantity; }
  public void setQuantity(double quantity) { this.quantity = quantity; }
  
  /*
   * Metoda zwraca obiekt ProductShortInfo
   * zawierający tylko nazwę i cenę
   * (np. na potrzeby katalogu produktów)
   */
  public ProductShortInfo getProductShortInfo() {
    return new ProductShortInfo(name, price);
  }
}
